﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TemplateMethodPattern
{
    public abstract class AbstractClass
    {
        /// <summary>
        /// 基本方法
        /// </summary>
        protected abstract void doSomething();
        /// <summary>
        /// 基本方法
        /// </summary>
        protected abstract void doAnything();

        /// <summary>
        /// 模板方法
        /// </summary>
        public void templateMethod()
        {
            //調用基本方法，完成相關的邏輯
            this.doAnything();
            this.doSomething();
        }
    }
}
